//
//  HomeTableViewCell.m
//  VEW
//
//  Created by lanou3g on 15/7/17.
//  Copyright (c) 2015年 Y团. All rights reserved.
//

#import "HomeTableViewCell.h"

@implementation HomeTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self layout];
    }
    return self;
}

//布局
-(void)layout
{
    //图片布局
    self.frame = CGRectMake(0, 0, CGRectGetWidth([[UIScreen mainScreen]bounds]), 160);
    self.z_image=[[UIImageView alloc]initWithFrame:CGRectMake(10, 10, (self.frame.size.width)*0.4-10, self.frame.size.height-20)];
    [self.contentView addSubview:self.z_image];
    //题目布局
    self.titleLabel=[[UILabel alloc]initWithFrame:CGRectMake(self.z_image.frame.size.width+20, self.z_image.frame.origin.y, self.frame.size.width*0.6-20, 70)];
    self.titleLabel.textAlignment=NSTextAlignmentJustified;

    self.titleLabel.numberOfLines = 0;
    self.titleLabel.font=[UIFont fontWithName:@"Helvetica-Bold" size:17];
    [self.contentView addSubview:self.titleLabel];
    //作者姓名布局
 
    self.nameLabel=[[UILabel alloc]initWithFrame:CGRectMake(self.z_image.frame.size.width+20, self.z_image.frame.size.height-30, self.nameLabel.frame.size.width, self.nameLabel.frame.size.height)];
    
    self.nameLabel.font=[UIFont systemFontOfSize:15];
//    self.nameLabel.backgroundColor = [UIColor greenColor];
    [self.contentView addSubview:self.nameLabel];
    //发布时间
    self.publishLabel=[[UILabel alloc]initWithFrame:CGRectMake(self.z_image.frame.size.width+20, self.z_image.frame.size.height-10, self.publishLabel.frame.size.width, self.publishLabel.frame.size.height)];
    self.publishLabel.font=[UIFont systemFontOfSize:15];
//    self.publishLabel.backgroundColor = [UIColor blueColor];
    [self.contentView addSubview:self.publishLabel];
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}


@end
